<template>
  <div class="home">
    <div class="fileBox">
<!--<el-button type="primary" class="importBtn" @click="importFileNew()" size="small">导入文件</el-button>-->
      <fileTree @func="getPresentData" :lineIdSon="lineId" :treeData="treeData"/>
      <el-button class="dialog" @click="saveFileTree()">保存</el-button>
      <el-button class="nodialog" @click="checkAlert=false">取消</el-button>
    </div>

  </div>
</template>

<script>
import fileTree from "@/components/fileTree";
export default {
  name: 'Home',
  data(){
    return {
      //文件树格式
      treeData:[
        {level: 1, id: 2, name: '文件夹01', child: [
            {level: 2, id: 101, name:"图片1.jpeg" , address:"https://uploader.shimo.im/f/R6dlsxchtpdU0tT7.png!thumbnail" },
            {level: 2, id: 102, name:"garden.png" , address:"https://oscimg.oschina.net/oscnet/up-f005a3a24024d675d766559fd13620e93ab.png" },
          ]},
        {level: 1, id: 3, name: '文件夹02', child: [
            {level: 2, id: 103, name:"图片3.jpeg" , address:"https://oscimg.oschina.net/oscnet/up-2bebbc3a274a46e2031cf8619f349bdf786.JPEG" },
            {level: 2, id: 104, name:"图片14.png" , address:"https://oscimg.oschina.net/oscnet/up-2bebbc3a274a46e2031cf8619f349bdf786.JPEG" },
            {level: 2, id: 105, name:"图片15.jpeg" , address:"https://oscimg.oschina.net/oscnet/up-2bebbc3a274a46e2031cf8619f349bdf786.JPEG" },
            {level: 2, id: 106, name:"图片104.png" , address:"https://oscimg.oschina.net/oscnet/up-2bebbc3a274a46e2031cf8619f349bdf786.JPEG" },
          ]},
      ],
      lineId: "", //树形结构管线ID
    }
  },
  components: {
    fileTree
  },
  methods: {
    //导入文件
    importFileNew(){},
    // 获取修改后的文件树
    getPresentData: function (e) {
      this.presentDataList = e;
    },
    // 保存文件树结构
    saveFileTree: function () {

    },
  }

}
</script>
<style lang="scss" scoped>
.home{
  .fileBox{
    width: 550px;
    display: block;
    margin: 10px auto;
    border-radius: 4px;
    .importBtn{
      display: flex;
      position: absolute;
    }
  }
}
</style>
